public class Dog extends Animal{
    private String name="旺财";

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }
    {
        System.out.println("子类实例代码块被执行了");
    }
    public Dog(String name, int age) {
        super(name, age);
        System.out.println("子类构造方法被执行了");
    }
    static{
        System.out.println("子类静态代码块被执行了");
    }
     public void fun(){
         System.out.println(this.name);
         System.out.println(super.name);
     }
}
